]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ScreenShield: constrain vertical movement of the screen lock
authorGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 3 Aug 2012 22:14:34 +0000 (00:14 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 16 Aug 2012 21:18:02 +0000 (23:18 +0200)
Don't allow dragging the screen lock above and below the screen,
as in particular dragging below breaks the illusion of the curtain.

https://bugzilla.gnome.org/show_bug.cgi?id=681143

js/ui/screenShield.js

index 11cc86adf0b3b2ec4f3942a23a3bd9fe9d4cfb9c..31355a6f7dcea959d1a514265e81cd4e5dc1ed74 100644 (file)
@@ -310,7 +310,11 @@ const ScreenShield = new Lang.Class({
         this._arrow.connect('repaint', Lang.bind(this, this._drawArrow));
         this._lockScreenContents.add_actor(this._arrow);
 
-        let action = new Clutter.DragAction({ drag_axis: Clutter.DragAxis.Y_AXIS });
+        let dragArea = new Clutter.Rect({ origin: new Clutter.Point({ x: 0, y: -global.screen_height, }),
+                                          size: new Clutter.Size({ width: global.screen_width,
+                                                                   height: global.screen_height }) });
+        let action = new Clutter.DragAction({ drag_axis: Clutter.DragAxis.Y_AXIS,
+                                              drag_area: dragArea });
         action.connect('drag-begin', Lang.bind(this, this._onDragBegin));
         action.connect('drag-end', Lang.bind(this, this._onDragEnd));
         this._lockScreenGroup.add_action(action);